package ch.wanandroid.lib.database;

import android.arch.persistence.room.Dao;
import android.arch.persistence.room.Delete;
import android.arch.persistence.room.Insert;
import android.arch.persistence.room.Query;
import android.arch.persistence.room.Update;

import java.util.List;

import ch.wanandroid.lib.net.beans.BannerResponse;

/**
 * Author: ch
 * Date: 2018/11/14 16:54
 * Description: ${DESCRIPTION}
 */
@Dao
public interface BannerResponseDao {

    @Query("SELECT * FROM BANNER_TABLE")
    List<BannerResponse> getAllBanners();

//    @Query("SELECT * FROM BANNER_TABLE WHERE id=:id")
//    List<BannerResponse> getTitileBanners();

    @Query("SELECT * FROM BANNER_TABLE WHERE title=:title")
    List<BannerResponse> getUsersByTitle(String title);

    @Insert
    void insert(BannerResponse bannerResponse);

    @Insert
    void insert(BannerResponse ...bannerResponse);

    @Insert
    void insertAll(List<BannerResponse> bannerResponseList);

    @Update
    void update(BannerResponse bannerResponse);

    @Delete
    void delete(BannerResponse bannerResponse);
}
